package com.bootdo.lvyou.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.lvyou.dao.LvyouScenicTicketOrderDao;
import com.bootdo.lvyou.domain.LvyouScenicTicketOrder;
import com.bootdo.lvyou.service.LvyouScenicTicketOrderService;



@Service
public class LvyouScenicTicketOrderServiceImpl implements LvyouScenicTicketOrderService {
	@Autowired
	private LvyouScenicTicketOrderDao lvyouScenicTicketOrderDao;
	
	@Override
	public LvyouScenicTicketOrder get(Long id){
		return lvyouScenicTicketOrderDao.get(id);
	}

	@Override
	public LvyouScenicTicketOrder getByOrderNoAndStatus(String orderNo, Integer status) {
		return lvyouScenicTicketOrderDao.getByOrderNoAndStatus(orderNo, status);
	}

	@Override
	public List<LvyouScenicTicketOrder> list(Map<String, Object> map){
		return lvyouScenicTicketOrderDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return lvyouScenicTicketOrderDao.count(map);
	}

	@Override
	public int updateStatusByOrderNo(Integer updateStatus, String orderNo, Integer status, String payOrderNo, String tkWxOrderNo) {
		return lvyouScenicTicketOrderDao.updateStatusByOrderNo(updateStatus, orderNo, status, payOrderNo, tkWxOrderNo);
	}


	@Override
	public int save(LvyouScenicTicketOrder lvyouScenicTicketOrder){
	
		if(lvyouScenicTicketOrder.getId() != null) {
			return lvyouScenicTicketOrderDao.update(lvyouScenicTicketOrder);
		}else {
			return lvyouScenicTicketOrderDao.save(lvyouScenicTicketOrder);
		}		
	
		
	}
	
	@Override
	public int update(LvyouScenicTicketOrder lvyouScenicTicketOrder){
		return lvyouScenicTicketOrderDao.update(lvyouScenicTicketOrder);
	}
	
	@Override
	public int remove(Long id){
		return lvyouScenicTicketOrderDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return lvyouScenicTicketOrderDao.batchRemove(ids);
	}
	
}
